<?php
@require("php_config_init.php");
@require("php_config_mysql.php");
$usertel = $_GET["usertel"];
$userpwd = $_GET["userpwd"];
$sql = "select id,usertel,userpwd from userinfo where usertel='$usertel' and status =1";
$result = mysql_query($sql);
$item = mysql_fetch_array($result);
$obj = array();
if($item){
    if($item["userpwd"] === $userpwd){
        $obj["code"] = 1;
        $obj["userid"] = $item["id"];
        $obj["msg"] = "登陆成功";
    }else{
        $obj["code"] = 0;
        $obj["msg"] = "密码错误";
    }
}else{
    $obj["code"] = 0;
    $obj["msg"] = "用户名不存在";
}
echo json_encode($obj);
?>